<?php
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin: *");

$dir = "history";
$list = [];

if (is_dir($dir)) {
    foreach (scandir($dir) as $f) {
        if (strpos($f, ".json")) {
            $list[] = $f;
        }
    }
}

echo json_encode($list);
?>
